﻿using System.Collections.Generic;
using ClassLibrary;
using ClassLibrary.Configuration;
using ClassLibrary.Configuration.WireCloud;

namespace ControlNode
{
    class RoutingController
    {
        private List<Link> links;

        public RoutingController()
        {
            //load network topology
            string path = @"d://WireCloudConfiguration.xml";
            var settings = (WireCloudConfig)Configuration.GetConfiguration(path, typeof(WireCloudConfig));
            links = settings.Links;
        }

        public SNPP[] RouteTableQuery(string src, string dst)
        {

            return new Dijkstra().dijkstra(links, src, dst);
        }

    }
}
